
env = Environment(
    tools = [ 'mingw' ]
)

env.Library( 'lib/fxkit', 'prog/fxkit.cpp',
             CPPPATH='./include'
)

test_files = Glob( 'test/test_*.cpp' )
prog_files = Glob( 'prog/prog_*.cpp' )

def FxTest( name ):
    env.Program( 'bin/%s_test' % name, 'test/test_%s.cpp' % name ,
        LIBS=[ 'gtest' ], LIBPATH=[ './lib' ],
        CPPPATH='./include'
    )

def FxProg( name ):
    env.Program( 'bin/%s_prog' % name, 'prog/prog_%s.cpp' % name ,
        LIBS=[ 'fxkit' ], LIBPATH=[ './lib' ],
        CPPPATH='./include'
    )

# SingleTest
for e in test_files:
    cls_name = str(e)[10:-4]
    FxTest( cls_name )

# ProgTest
for e in prog_files:
    cls_name = str(e)[10:-4]
    FxProg( cls_name )

# AllTest
all_test_env = env.Clone()
all_test_env.Program( 'bin/AllTest', 'test/AllTest.cpp' ,
    LIBS=[ 'gtest_main' ], LIBPATH=[ './lib' ],
    CPPPATH='./include', CCFLAGS='-DFX_TEST_ALL'
)

#env.Alias( 'install', install_dir )

# Depends( hello, 'other_file' ) Ignore()
# Program( 'hijack', src_files, LIBS=['foo'], LIBPATH=['.'], CPPPATH='.' )
# SharedLibrary( 'hijack', src_files )
# Object( 'hello.c', CCFLAGS='-DHELLO' )
# Sconscript( ['./hi'] )

# File() Dir() Entry()
# AlwaysBuild() Precious() NoClean() Clean()
# Copy Delete Move Touch Mkdir

